package com.bigshen.demo.annotation.configurecomponents.a1ComponentScan;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Arrays;

public class MyTest {

    @Test
    public void test() {

        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(MyConfig.class);

        String[] beanNames = applicationContext.getBeanDefinitionNames();
        System.out.println(Arrays.toString(beanNames)
        .replaceAll("\\[", "")
        .replaceAll("\\]", "")
        .replace(", ", "\n"));

    }

}
